function [Pos, Neg] = neighbor(Maze, target, now)
  Pos = [];
  Neg = [];

  waitlist = [-1, 0; 1, 0; 0, -1; 0, 1];
  for k = 1:4
    cand = now + waitlist(k,:);

    if min(cand) < 1 || sum(cand > size(Maze)) > 0
      continue;
    end

    if isnan(Maze(cand(1),cand(2))) ~= 1
      continue;
    end

    if distman(cand, target) + 1 == distman(now, target)
      Pos = [Pos; cand];
    elseif distman(cand, target) - 1 == distman(now, target)
      Neg = [Neg; cand];
    end

  end

end
